package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by oyhk on 16/7/15.
 */
@Entity
@Table(name = "merchant_fund")
@DynamicInsert
@DynamicUpdate
public class MerchantFund extends IDEntityMall {
    /**
     * 总金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '总金额'")
    private BigDecimal totalAmount = BigDecimal.valueOf(0);

    /**
     * 冻结金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '冻结金额'")
    private BigDecimal frozen = BigDecimal.valueOf(0);

    /**
     * 可用金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '可用金额'")
    private BigDecimal availableAmount = BigDecimal.valueOf(0);

    /**
     * 商户id
     */
    @Column(columnDefinition = "bigint comment '商户id'")
    private Long merchantId;

    /**
     * 平台id
     */
    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;


    /**
     *实际充值累计金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '实际充值累计金额'")
    private BigDecimal actualRechargeAmount =BigDecimal.valueOf(0);


    /**
     * 实际充值赠送金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '实际充值赠送金额：普通充值+赠送充值'")
    private BigDecimal presentRechargeAmount =BigDecimal.valueOf(0);


    /**
     * 不可提现金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '不可提现金额'")
    private BigDecimal canNotWithdrawAmount =BigDecimal.valueOf(0);


    public static final String ATTR_THIS = "merchantFund";

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getFrozen() {
        return frozen;
    }

    public void setFrozen(BigDecimal frozen) {
        this.frozen = frozen;
    }

    public BigDecimal getAvailableAmount() {
        return availableAmount;
    }

    public void setAvailableAmount(BigDecimal availableAmount) {
        this.availableAmount = availableAmount;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getActualRechargeAmount() {
        return actualRechargeAmount;
    }

    public void setActualRechargeAmount(BigDecimal actualRechargeAmount) {
        this.actualRechargeAmount = actualRechargeAmount;
    }

    public BigDecimal getPresentRechargeAmount() {
        return presentRechargeAmount;
    }

    public void setPresentRechargeAmount(BigDecimal presentRechargeAmount) {
        this.presentRechargeAmount = presentRechargeAmount;
    }

    public BigDecimal getCanNotWithdrawAmount() {
        return canNotWithdrawAmount;
    }

    public void setCanNotWithdrawAmount(BigDecimal canNotWithdrawAmount) {
        this.canNotWithdrawAmount = canNotWithdrawAmount;
    }

    @Override
    public String toString() {
        return "MerchantFund{" +
                "totalAmount=" + totalAmount +
                ", id=" + id +
                ", dateCreated=" + dateCreated +
                ", frozen=" + frozen +
                ", lastUpdated=" + lastUpdated +
                ", availableAmount=" + availableAmount +
                ", isDelete=" + isDelete +
                ", merchantId=" + merchantId +
                ", version=" + version +
                ", mallId=" + mallId +
                ", actualRechargeAmount=" + actualRechargeAmount +
                ", presentRechargeAmount=" + presentRechargeAmount +
                ", canNotWithdrawAmount=" + canNotWithdrawAmount +
                '}';
    }
}
